package atguigu.volatiledemo;

public class VolatileTest extends Thread {
	public static volatile int a = 0;

	public void run() {
		a++;
	}

	public static void main(String[] args) {
		VolatileTest array[] = new VolatileTest[10000];
		for (int i = 0; i < array.length; i++) {
			array[i] = new VolatileTest();
			array[i].start();
		}
		System.out.println(VolatileTest.a);
	}
}